<%@page import="com.sun.java.swing.plaf.windows.resources.windows"%>
<%@page import="sun.security.util.Password"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.sql.*,java.util.*"%>
<%@ include file="dbconn.jsp"%>
<%
	String path = request.getContextPath();	
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<basehref="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>合同管理系统</title>

</head>
<body>
<%
		request.setCharacterEncoding("utf-8");
	    int con_id=Integer.valueOf(request.getParameter("con_id"));
		String con_name=request.getParameter("con_name");		
		int con_state=0;
		String con_drafter=request.getParameter("con_drafter");
		String con_approver=request.getParameter("con_approve");	
		String sigin_date=request.getParameter("sigin_date");
		String closing_date=request.getParameter("closing_date");
		String con_amount=request.getParameter("con_amount");
		String con_pay=request.getParameter("con_pay");
		String con_nonpay=request.getParameter("con_nonpay");
		try{
			 if(conn != null){
				 String sql="insert into t_contract (con_id,con_name,sigin_date,closing_date,con_amount,con_pay,con_nonpay,con_state,con_drafter)  values("+con_id+",'"+con_name+"','"+sigin_date+"','"+closing_date+"','"+con_amount+"','"+con_pay+"','"+con_nonpay+"',"+con_state+",'"+con_drafter+"')";	
		         st.executeUpdate(sql);  
		         request.getRequestDispatcher("/conlist.jsp").forward(request, response);               
		            // 输出连接信息  
		           // out.println("数据库连接成功！");  
		            // 关闭数据库连接  
			 }
			else{  
				            // 输出连接信息  
				 out.println("数据库连接失败！");                          
			}  
		}catch (SQLException e) {  
				e.printStackTrace();  
				request.getRequestDispatcher("/conlist.jsp").forward(request, response);
		}finally{
			 conn.close();  
		}
		

 

%>
</body>
</html>